//
//  HMHomeRecommendListModel.m
//  HowToDo
//
//  Created by Stan on 2017-01-04.
//  Copyright © 2017 KY. All rights reserved.
//

#import "HMHomeRecommendListModel.h"
#import <YYModel.h>

@implementation HMHomeRecommendListModel

+ (void)loadJsonDataDataWithType:(NSInteger)type andOrderBy:(NSString *)orderType andPage:(NSInteger)page andFinished:(void(^)(id responseObject))finishBlock{
    
    [[HMNetWorkTool sharedTool]requestRecommendJsonDataWithType:type andOrderBy:orderType andPage:page andFinished:^(id responseObject) {
        if ([responseObject isKindOfClass:[NSDictionary class]]) {
            
//            字典转模型
            NSArray *recommendListArray = [NSArray yy_modelArrayWithClass:[HMHomeRecommendListModel class] json:responseObject[@"data"]];
            
            finishBlock(recommendListArray);
        }
        
    } Failed:^(NSError *error) {
        HMLog(@"error = %@",error);
        
    }];
}
@end
